using DAO;
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace Easislides
{
	public class FrmSmartMerge : Form
	{
		private string SongLyricsB;
		private string SongLyricsA;
		private string SongSequenceB;
		private string SongSequenceA;
		private string SongCopyrightB;
		private string SongCopyrightA;
		private string BookReferenceB;
		private string BookReferenceA;
		private string UserReferenceB;
		private string UserReferenceA;
		private string SongWriterInfoB;
		private string SongWriterInfoA;
		private string SongLayoutSequenceB;
		private string SongLayoutSequenceA;
		private string SongTimingA;
		private string SongKeyA;
		private string SongCapoA;
		private string SongTimingB;
		private string SongKeyB;
		private string SongCapoB;
		private string SongAdminB;
		private string SongAdminA;
		private int SongID2;
		private int SongID1;
		private bool InitLoad;
		private gf.SongSettings SmartMergeItemA = new gf.SongSettings();
		private gf.SongSettings SmartMergeItemB = new gf.SongSettings();
		private ListView LyricsAndNotationsListA = new ListView();
		private ListView LyricsAndNotationsListB = new ListView();
		private ListView TempSongsList = new ListView();
		private IContainer components = null;
		private GroupBox groupBox1;
		private GroupBox groupBox2;
		private Button BtnCancel;
		private Button BtnOK;
		private CheckBox cbTickAll;
		private GroupBox groupBox3;
		private ProgressBar ProgressBar1;
		private GroupBox groupBox4;
		private RadioButton OptionSourceATitle1;
		private ComboBox SongFolderA;
		private RadioButton OptionSourceATitle2;
		private GroupBox groupBox5;
		private RadioButton OptionSourceBTitle2;
		private RadioButton OptionSourceBTitle1;
		private ComboBox SongFolderB;
		private GroupBox groupBox6;
		private RadioButton OptionNewTitleAB;
		private RadioButton OptionNewTitleA;
		private ComboBox SongFolderC;
		private ListView SongsList;
		private ColumnHeader columnHeader1;
		private ColumnHeader columnHeader2;
		private ColumnHeader columnHeader3;
		private ColumnHeader columnHeader4;
		private ColumnHeader columnHeader5;
		public FrmSmartMerge()
		{
			this.InitializeComponent();
		}
		private void FrmSmartMerge_Load(object sender, EventArgs e)
		{
			this.SmartMergeItemA.Initialise();
			this.SmartMergeItemB.Initialise();
			gf.SetListViewColumns(this.LyricsAndNotationsListA, 5);
			gf.SetListViewColumns(this.LyricsAndNotationsListB, 5);
			gf.SetListViewColumns(this.TempSongsList, 6);
			this.InitLoad = true;
			this.BuildFolderList();
			this.UnselFolders();
			this.InitLoad = false;
			this.ProgressBar1.Value = 0;
		}
		private void BuildFolderList()
		{
			this.SongFolderA.Items.Clear();
			this.SongFolderB.Items.Clear();
			this.SongFolderC.Items.Clear();
			for (int i = 1; i < 41; i++)
			{
				if (gf.FolderUse[i] > 0)
				{
					this.SongFolderA.Items.Add(gf.FolderName[i]);
					this.SongFolderB.Items.Add(gf.FolderName[i]);
					this.SongFolderC.Items.Add(gf.FolderName[i]);
				}
			}
		}
		private void UnselFolders()
		{
			this.SongFolderA.Text = "";
			this.SongFolderB.Text = "";
			this.SongFolderC.Text = "";
		}
		private int DisplayCount()
		{
			int count = this.SongsList.Items.Count;
			int result;
			if (count < 1)
			{
				this.SongsList.Columns[0].Text = "No Matching Items found";
				result = 0;
			}
			else
			{
				int count2 = this.SongsList.CheckedItems.Count;
				this.SongsList.Columns[0].Text = string.Concat(new string[]
				{
					" ",
					count.ToString(),
					" items identified : ",
					Convert.ToString(count2),
					" ticked for Merging"
				});
				result = count2;
			}
			return result;
		}
		private void SongsList_KeyUp(object sender, KeyEventArgs e)
		{
			this.SongsListItemTicked();
		}
		private void SongsList_MouseUp(object sender, MouseEventArgs e)
		{
			this.SongsListItemTicked();
		}
		private void SongsListItemTicked()
		{
			if (this.SongsList.Items.Count == this.SongsList.CheckedItems.Count)
			{
				this.cbTickAll.CheckState = CheckState.Checked;
			}
			else
			{
				if (this.SongsList.CheckedItems.Count == 0)
				{
					this.cbTickAll.CheckState = CheckState.Unchecked;
				}
				else
				{
					this.cbTickAll.CheckState = CheckState.Indeterminate;
				}
			}
			this.SetCheckBoxes();
		}
		private void SetCheckBoxes()
		{
			if (this.SongsList.Items.Count != 0)
			{
				if (this.cbTickAll.CheckState == CheckState.Checked)
				{
					for (int i = this.SongsList.Items.Count - 1; i >= 0; i--)
					{
						this.SongsList.Items[i].Checked = true;
					}
				}
				else
				{
					if (this.cbTickAll.CheckState == CheckState.Unchecked)
					{
						for (int i = this.SongsList.Items.Count - 1; i >= 0; i--)
						{
							this.SongsList.Items[i].Checked = false;
						}
					}
				}
				this.BtnOK.Enabled = (this.SongsList.CheckedItems.Count > 0);
				this.DisplayCount();
			}
		}
		private void cbTickAll_MouseUp(object sender, MouseEventArgs e)
		{
			this.SetCheckBoxes();
		}
		private void cbTickAll_KeyUp(object sender, KeyEventArgs e)
		{
			this.SetCheckBoxes();
		}
		private void OptionSourceABTitle1_CheckedChanged(object sender, EventArgs e)
		{
			this.BuildMatchingList();
		}
		private void OptionNewTitleA_CheckedChanged(object sender, EventArgs e)
		{
			if (this.SongsList.Items.Count > 0)
			{
				for (int i = 0; i < this.SongsList.Items.Count; i++)
				{
					this.SongsList.Items[i].SubItems[0].Text = this.SongsList.Items[i].SubItems[3].Text + (this.OptionNewTitleA.Checked ? (" (" + this.SongsList.Items[i].SubItems[4].Text + ")") : "");
				}
			}
		}
		private void BuildMatchingList()
		{
			if (!(this.InitLoad | this.SongFolderA.Text == "" | this.SongFolderB.Text == ""))
			{
				this.Cursor = Cursors.WaitCursor;
				ListViewItem listViewItem = new ListViewItem();
				this.SongsList.Items.Clear();
				this.TempSongsList.Items.Clear();
				string text;
				if (this.OptionSourceATitle1.Checked)
				{
					text = "Title_1";
				}
				else
				{
					text = "Title_2";
				}
				string text2 = this.SongFolderA.Items[this.SongFolderA.SelectedIndex].ToString();
				text2 = "select * from SONG where Folderno=" + gf.GetFolderNumber(text2).ToString();
				if (this.OptionSourceBTitle1.Checked)
				{
					text = "Title_1";
				}
				else
				{
					text = "Title_2";
				}
				int num = 0;
				try
				{
					Recordset recordSet = gf.GetRecordSet(gf.ConnectStringMainDB, text2);
					Database daoDb = gf.GetDaoDb(gf.ConnectStringMainDB);
					if (recordSet != null && !recordSet.EOF)
					{
						recordSet.MoveFirst();
						while (!recordSet.EOF)
						{
							this.SongID1 = gf.ObjToInt(recordSet.Fields["SongID"].Value);
							string text3;
							if (this.OptionSourceATitle1.Checked)
							{
								text3 = gf.ObjToString(recordSet.Fields["Title_1"].Value);
							}
							else
							{
								text3 = gf.ObjToString(recordSet.Fields["Title_2"].Value);
							}
							if (gf.Trim(text3) != "")
							{
								string text4 = gf.ObjToString(recordSet.Fields["Title_1"].Value);
								string text5 = this.SongFolderB.Items[this.SongFolderB.SelectedIndex].ToString();
								text5 = string.Concat(new string[]
								{
									"select * from SONG where Folderno=",
									gf.GetFolderNumber(text5).ToString(),
									" and LCase(",
									text,
									") like LCase(\"",
									text3,
									"\") "
								});
								try
								{
									Recordset recordSet2 = gf.GetRecordSet(daoDb, text5);
									if (recordSet2 != null && !recordSet2.EOF)
									{
										recordSet2.MoveFirst();
										while (!recordSet2.EOF)
										{
											this.SongID2 = gf.ObjToInt(recordSet2.Fields["SongID"].Value);
											num++;
											string initTitle = this.GetInitTitle(gf.ObjToString(recordSet2.Fields["Title_1"].Value));
											string text6 = text4 + (this.OptionNewTitleA.Checked ? (" (" + initTitle + ")") : "");
											listViewItem = this.TempSongsList.Items.Add(gf.GetCJKTitle(text6, gf.SortBy.Alpha));
											listViewItem.SubItems.Add(text6);
											listViewItem.SubItems.Add(this.SongID1.ToString());
											listViewItem.SubItems.Add(this.SongID2.ToString());
											listViewItem.SubItems.Add(text4);
											listViewItem.SubItems.Add(initTitle);
											recordSet2.MoveNext();
										}
									}
								}
								catch
								{
								}
							}
							recordSet.MoveNext();
						}
					}
				}
				catch
				{
				}
				this.TempSongsList.Sorting = SortOrder.Ascending;
				this.TempSongsList.Sort();
				if (this.TempSongsList.Items.Count > 0)
				{
					for (int i = 0; i < this.TempSongsList.Items.Count; i++)
					{
						listViewItem = this.SongsList.Items.Add(this.TempSongsList.Items[i].SubItems[1].Text);
						listViewItem.SubItems.Add(this.TempSongsList.Items[i].SubItems[2].Text);
						listViewItem.SubItems.Add(this.TempSongsList.Items[i].SubItems[3].Text);
						listViewItem.SubItems.Add(this.TempSongsList.Items[i].SubItems[4].Text);
						listViewItem.SubItems.Add(this.TempSongsList.Items[i].SubItems[5].Text);
					}
				}
				this.DisplayCount();
				this.Cursor = Cursors.Default;
			}
		}
		private string GetInitTitle(string InTitle)
		{
			if (gf.Left(InTitle, 1) != "(")
			{
				int num = InTitle.IndexOf("(");
				if (num >= 0)
				{
					InTitle = gf.Left(InTitle, num - 1);
				}
			}
			return gf.Trim(InTitle);
		}
		private void BtnOK_Click(object sender, EventArgs e)
		{
			this.Start_Merge();
		}
		private void Start_Merge()
		{
			int num = this.DisplayCount();
			if (this.SongFolderA.Text == "")
			{
				MessageBox.Show("Please select a folder for Source A before proceeding");
			}
			else
			{
				if (this.SongFolderB.Text == "")
				{
					MessageBox.Show("Please select a folder for Source B before proceeding");
				}
				else
				{
					if (this.SongFolderC.Text == "")
					{
						MessageBox.Show("Please select a Destination Folder to hold the new merged items");
					}
					else
					{
						if (this.SongsList.Items.Count <= 0)
						{
							MessageBox.Show("There aren't any items listed for merging!");
						}
						else
						{
							if (num <= 0)
							{
								MessageBox.Show("Cannot find any items Ticked for merging!");
							}
							else
							{
								string inLyrics = "";
								string inNotations = "";
								string folderNum = gf.GetFolderNumber(this.SongFolderC.Items[this.SongFolderC.SelectedIndex].ToString()).ToString();
								int num2 = 0;
								for (int i = 0; i < this.SongsList.Items.Count; i++)
								{
									if (this.SongsList.Items[i].Checked)
									{
										this.SongID1 = gf.StringToInt(this.SongsList.Items[i].SubItems[1].Text);
										if (this.LookUpSong(this.SongID1.ToString(), ref this.SmartMergeItemA, ref this.SongLayoutSequenceA, ref this.SongLyricsA, ref this.SongSequenceA, ref this.SongCopyrightA, ref this.BookReferenceA, ref this.UserReferenceA, ref this.SongWriterInfoA, ref this.SongCapoA, ref this.SongKeyA, ref this.SongTimingA, ref this.SongAdminA))
										{
											this.SongID2 = gf.StringToInt(this.SongsList.Items[i].SubItems[2].Text);
											if (this.LookUpSong(this.SongID2.ToString(), ref this.SmartMergeItemB, ref this.SongLayoutSequenceB, ref this.SongLyricsB, ref this.SongSequenceB, ref this.SongCopyrightB, ref this.BookReferenceB, ref this.UserReferenceB, ref this.SongWriterInfoB, ref this.SongCapoB, ref this.SongKeyB, ref this.SongTimingB, ref this.SongAdminB))
											{
												gf.Merge_Songs(this.SmartMergeItemA, this.SmartMergeItemB, ref inLyrics, ref inNotations);
												this.SaveSong(this.SongsList.Items[i].SubItems[0].Text, folderNum, this.SongsList.Items[i].SubItems[3].Text, inLyrics, inNotations, this.SongSequenceA, (this.SongCopyrightA != "") ? this.SongCopyrightA : this.SongCopyrightB, this.BookReferenceA + ((this.BookReferenceA != "" & this.BookReferenceB != "") ? "," : "") + this.BookReferenceB, this.UserReferenceA + ((this.UserReferenceA != "" & this.UserReferenceB != "") ? "," : "") + this.UserReferenceB, (this.SongWriterInfoA != "") ? this.SongWriterInfoA : this.SongWriterInfoB, (this.SongCapoA != "-1") ? this.SongCapoA : this.SongCapoB, (this.SongKeyA != "") ? this.SongKeyA : this.SongKeyB, (this.SongTimingA != "") ? this.SongTimingA : this.SongTimingB, this.SongAdminA, this.SongAdminB);
												num2++;
											}
										}
										this.ProgressBar1.Value = num2 / num * 100;
									}
								}
								MessageBox.Show(num2.ToString() + " newly merged items have been created in Folder '" + this.SongFolderC.Items[this.SongFolderC.SelectedIndex].ToString() + "'");
								this.ProgressBar1.Value = 0;
							}
						}
					}
				}
			}
		}
		private bool LookUpSong(string InID, ref gf.SongSettings InItem, ref string LayoutSequence, ref string Lyrics, ref string DBSequence, ref string Copyright, ref string BookReference, ref string UserReference, ref string Writer, ref string SongCapo, ref string SongKey, ref string SongTiming, ref string SongAdmin)
		{
			bool result;
			if (!gf.ValidateDB(gf.DatabaseType.Songs))
			{
				result = false;
			}
			else
			{
				if (!gf.ValidSongID(gf.StringToInt(InID)))
				{
					result = false;
				}
				else
				{
					try
					{
						string fullSearchString = "select * from SONG where songid=" + InID;
						Recordset recordSet = gf.GetRecordSet(gf.ConnectStringMainDB, fullSearchString);
						if (recordSet != null && !recordSet.EOF)
						{
							recordSet.MoveFirst();
							BookReference = gf.ObjToString(recordSet.Fields["Book_Reference"].Value);
							UserReference = gf.ObjToString(recordSet.Fields["User_Reference"].Value);
							Copyright = gf.ObjToString(recordSet.Fields["Copyright"].Value);
							Writer = gf.ObjToString(recordSet.Fields["Writer"].Value);
							SongCapo = gf.ObjToInt(recordSet.Fields["capo"].Value, true).ToString();
							SongKey = gf.ObjToString(recordSet.Fields["Key"].Value);
							SongTiming = gf.ObjToString(recordSet.Fields["Timing"].Value);
							SongAdmin = gf.ObjToString(recordSet.Fields["LICENCE_ADMIN1"].Value);
							if (SongAdmin == "")
							{
								SongAdmin = gf.ObjToString(recordSet.Fields["LICENCE_ADMIN2"].Value);
							}
							InItem.SongSequence = gf.ObjToString(recordSet.Fields["Sequence"].Value);
							InItem.CompleteLyrics = gf.ObjToString(recordSet.Fields["Lyrics"].Value);
							InItem.Notations = gf.ObjToString(recordSet.Fields["msc"].Value);
							gf.FormatDisplayLyrics(ref InItem, false, true);
							DBSequence = InItem.SongSequence;
						}
					}
					catch
					{
					}
					result = true;
				}
			}
			return result;
		}
		private void SaveSong(string Title, string FolderNum, string Title2, string InLyrics, string InNotations, string Sequence, string Copyright, string BookReference, string UserReference, string Writer, string SongCapo, string SongKey, string SongTiming, string SongAdmin1, string SongAdmin2)
		{
			int num = gf.InsertItemIntoDatabase(gf.ConnectStringMainDB, Title, Title2, 0, gf.StringToInt(FolderNum), InLyrics, Sequence, Writer, Copyright, SongCapo, SongTiming, SongKey, InNotations, "", SongAdmin1, SongAdmin2, BookReference, UserReference, "", "");
		}
		protected override void Dispose(bool disposing)
		{
			if (disposing && this.components != null)
			{
				this.components.Dispose();
			}
			base.Dispose(disposing);
		}
		private void InitializeComponent()
		{
            this.groupBox1 = new System.Windows.Forms.GroupBox();
            this.groupBox5 = new System.Windows.Forms.GroupBox();
            this.OptionSourceBTitle2 = new System.Windows.Forms.RadioButton();
            this.OptionSourceBTitle1 = new System.Windows.Forms.RadioButton();
            this.SongFolderB = new System.Windows.Forms.ComboBox();
            this.groupBox3 = new System.Windows.Forms.GroupBox();
            this.OptionSourceATitle2 = new System.Windows.Forms.RadioButton();
            this.OptionSourceATitle1 = new System.Windows.Forms.RadioButton();
            this.SongFolderA = new System.Windows.Forms.ComboBox();
            this.groupBox2 = new System.Windows.Forms.GroupBox();
            this.groupBox6 = new System.Windows.Forms.GroupBox();
            this.OptionNewTitleAB = new System.Windows.Forms.RadioButton();
            this.OptionNewTitleA = new System.Windows.Forms.RadioButton();
            this.SongFolderC = new System.Windows.Forms.ComboBox();
            this.BtnCancel = new System.Windows.Forms.Button();
            this.BtnOK = new System.Windows.Forms.Button();
            this.cbTickAll = new System.Windows.Forms.CheckBox();
            this.ProgressBar1 = new System.Windows.Forms.ProgressBar();
            this.groupBox4 = new System.Windows.Forms.GroupBox();
            this.SongsList = new System.Windows.Forms.ListView();
            this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
            this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
            this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
            this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
            this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
            this.groupBox1.SuspendLayout();
            this.groupBox5.SuspendLayout();
            this.groupBox3.SuspendLayout();
            this.groupBox2.SuspendLayout();
            this.groupBox6.SuspendLayout();
            this.groupBox4.SuspendLayout();
            this.SuspendLayout();
            // 
            // groupBox1
            // 
            this.groupBox1.Controls.Add(this.groupBox5);
            this.groupBox1.Controls.Add(this.groupBox3);
            this.groupBox1.Location = new System.Drawing.Point(12, 12);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new System.Drawing.Size(332, 114);
            this.groupBox1.TabIndex = 0;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "Identify Matching Titles from Source A and Source B";
            // 
            // groupBox5
            // 
            this.groupBox5.Controls.Add(this.OptionSourceBTitle2);
            this.groupBox5.Controls.Add(this.OptionSourceBTitle1);
            this.groupBox5.Controls.Add(this.SongFolderB);
            this.groupBox5.Location = new System.Drawing.Point(169, 19);
            this.groupBox5.Name = "groupBox5";
            this.groupBox5.Size = new System.Drawing.Size(153, 89);
            this.groupBox5.TabIndex = 1;
            this.groupBox5.TabStop = false;
            this.groupBox5.Text = "Source B (Region 2)";
            // 
            // OptionSourceBTitle2
            // 
            this.OptionSourceBTitle2.AutoSize = true;
            this.OptionSourceBTitle2.Location = new System.Drawing.Point(17, 61);
            this.OptionSourceBTitle2.Name = "OptionSourceBTitle2";
            this.OptionSourceBTitle2.Size = new System.Drawing.Size(54, 17);
            this.OptionSourceBTitle2.TabIndex = 2;
            this.OptionSourceBTitle2.Text = "Title 2";
            // 
            // OptionSourceBTitle1
            // 
            this.OptionSourceBTitle1.AutoSize = true;
            this.OptionSourceBTitle1.Checked = true;
            this.OptionSourceBTitle1.Location = new System.Drawing.Point(17, 43);
            this.OptionSourceBTitle1.Name = "OptionSourceBTitle1";
            this.OptionSourceBTitle1.Size = new System.Drawing.Size(54, 17);
            this.OptionSourceBTitle1.TabIndex = 1;
            this.OptionSourceBTitle1.TabStop = true;
            this.OptionSourceBTitle1.Text = "Title 1";
            this.OptionSourceBTitle1.CheckedChanged += new System.EventHandler(this.OptionSourceABTitle1_CheckedChanged);
            // 
            // SongFolderB
            // 
            this.SongFolderB.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.SongFolderB.FormattingEnabled = true;
            this.SongFolderB.Location = new System.Drawing.Point(6, 19);
            this.SongFolderB.MaxDropDownItems = 12;
            this.SongFolderB.Name = "SongFolderB";
            this.SongFolderB.Size = new System.Drawing.Size(141, 21);
            this.SongFolderB.TabIndex = 0;
            this.SongFolderB.SelectedIndexChanged += new System.EventHandler(this.OptionSourceABTitle1_CheckedChanged);
            // 
            // groupBox3
            // 
            this.groupBox3.Controls.Add(this.OptionSourceATitle2);
            this.groupBox3.Controls.Add(this.OptionSourceATitle1);
            this.groupBox3.Controls.Add(this.SongFolderA);
            this.groupBox3.Location = new System.Drawing.Point(8, 19);
            this.groupBox3.Name = "groupBox3";
            this.groupBox3.Size = new System.Drawing.Size(153, 89);
            this.groupBox3.TabIndex = 0;
            this.groupBox3.TabStop = false;
            this.groupBox3.Text = "Source A (Region 1)";
            // 
            // OptionSourceATitle2
            // 
            this.OptionSourceATitle2.AutoSize = true;
            this.OptionSourceATitle2.Checked = true;
            this.OptionSourceATitle2.Location = new System.Drawing.Point(17, 61);
            this.OptionSourceATitle2.Name = "OptionSourceATitle2";
            this.OptionSourceATitle2.Size = new System.Drawing.Size(54, 17);
            this.OptionSourceATitle2.TabIndex = 2;
            this.OptionSourceATitle2.TabStop = true;
            this.OptionSourceATitle2.Text = "Title 2";
            // 
            // OptionSourceATitle1
            // 
            this.OptionSourceATitle1.AutoSize = true;
            this.OptionSourceATitle1.Location = new System.Drawing.Point(17, 43);
            this.OptionSourceATitle1.Name = "OptionSourceATitle1";
            this.OptionSourceATitle1.Size = new System.Drawing.Size(54, 17);
            this.OptionSourceATitle1.TabIndex = 1;
            this.OptionSourceATitle1.Text = "Title 1";
            this.OptionSourceATitle1.CheckedChanged += new System.EventHandler(this.OptionSourceABTitle1_CheckedChanged);
            // 
            // SongFolderA
            // 
            this.SongFolderA.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.SongFolderA.FormattingEnabled = true;
            this.SongFolderA.Location = new System.Drawing.Point(6, 19);
            this.SongFolderA.MaxDropDownItems = 12;
            this.SongFolderA.Name = "SongFolderA";
            this.SongFolderA.Size = new System.Drawing.Size(141, 21);
            this.SongFolderA.TabIndex = 0;
            this.SongFolderA.SelectedIndexChanged += new System.EventHandler(this.OptionSourceABTitle1_CheckedChanged);
            // 
            // groupBox2
            // 
            this.groupBox2.Controls.Add(this.groupBox6);
            this.groupBox2.Location = new System.Drawing.Point(347, 12);
            this.groupBox2.Name = "groupBox2";
            this.groupBox2.Size = new System.Drawing.Size(169, 114);
            this.groupBox2.TabIndex = 1;
            this.groupBox2.TabStop = false;
            this.groupBox2.Text = "Merge Matching Items into";
            // 
            // groupBox6
            // 
            this.groupBox6.Controls.Add(this.OptionNewTitleAB);
            this.groupBox6.Controls.Add(this.OptionNewTitleA);
            this.groupBox6.Controls.Add(this.SongFolderC);
            this.groupBox6.Location = new System.Drawing.Point(8, 19);
            this.groupBox6.Name = "groupBox6";
            this.groupBox6.Size = new System.Drawing.Size(153, 89);
            this.groupBox6.TabIndex = 0;
            this.groupBox6.TabStop = false;
            this.groupBox6.Text = "Destination Folder";
            // 
            // OptionNewTitleAB
            // 
            this.OptionNewTitleAB.AutoSize = true;
            this.OptionNewTitleAB.Location = new System.Drawing.Point(17, 61);
            this.OptionNewTitleAB.Name = "OptionNewTitleAB";
            this.OptionNewTitleAB.Size = new System.Drawing.Size(116, 17);
            this.OptionNewTitleAB.TabIndex = 4;
            this.OptionNewTitleAB.Text = "Source A Title Only";
            // 
            // OptionNewTitleA
            // 
            this.OptionNewTitleA.AutoSize = true;
            this.OptionNewTitleA.Checked = true;
            this.OptionNewTitleA.Location = new System.Drawing.Point(17, 43);
            this.OptionNewTitleA.Name = "OptionNewTitleA";
            this.OptionNewTitleA.Size = new System.Drawing.Size(112, 17);
            this.OptionNewTitleA.TabIndex = 1;
            this.OptionNewTitleA.TabStop = true;
            this.OptionNewTitleA.Text = "Merge Titles A && B";
            this.OptionNewTitleA.CheckedChanged += new System.EventHandler(this.OptionNewTitleA_CheckedChanged);
            // 
            // SongFolderC
            // 
            this.SongFolderC.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.SongFolderC.FormattingEnabled = true;
            this.SongFolderC.Location = new System.Drawing.Point(6, 19);
            this.SongFolderC.MaxDropDownItems = 12;
            this.SongFolderC.Name = "SongFolderC";
            this.SongFolderC.Size = new System.Drawing.Size(141, 21);
            this.SongFolderC.TabIndex = 0;
            // 
            // BtnCancel
            // 
            this.BtnCancel.Location = new System.Drawing.Point(436, 355);
            this.BtnCancel.Name = "BtnCancel";
            this.BtnCancel.Size = new System.Drawing.Size(80, 24);
            this.BtnCancel.TabIndex = 6;
            this.BtnCancel.Text = "Close";
            this.BtnCancel.Click += new System.EventHandler(this.BtnCancel_Click);
            // 
            // BtnOK
            // 
            this.BtnOK.Location = new System.Drawing.Point(340, 355);
            this.BtnOK.Name = "BtnOK";
            this.BtnOK.Size = new System.Drawing.Size(80, 24);
            this.BtnOK.TabIndex = 5;
            this.BtnOK.Text = "Start Merge";
            this.BtnOK.Click += new System.EventHandler(this.BtnOK_Click);
            // 
            // cbTickAll
            // 
            this.cbTickAll.AutoSize = true;
            this.cbTickAll.Location = new System.Drawing.Point(21, 355);
            this.cbTickAll.Name = "cbTickAll";
            this.cbTickAll.Size = new System.Drawing.Size(61, 17);
            this.cbTickAll.TabIndex = 4;
            this.cbTickAll.Text = "Tick All";
            this.cbTickAll.ThreeState = true;
            this.cbTickAll.KeyUp += new System.Windows.Forms.KeyEventHandler(this.cbTickAll_KeyUp);
            this.cbTickAll.MouseUp += new System.Windows.Forms.MouseEventHandler(this.cbTickAll_MouseUp);
            // 
            // ProgressBar1
            // 
            this.ProgressBar1.Location = new System.Drawing.Point(12, 326);
            this.ProgressBar1.Name = "ProgressBar1";
            this.ProgressBar1.Size = new System.Drawing.Size(504, 21);
            this.ProgressBar1.TabIndex = 3;
            // 
            // groupBox4
            // 
            this.groupBox4.Controls.Add(this.SongsList);
            this.groupBox4.Location = new System.Drawing.Point(12, 127);
            this.groupBox4.Name = "groupBox4";
            this.groupBox4.Size = new System.Drawing.Size(504, 198);
            this.groupBox4.TabIndex = 2;
            this.groupBox4.TabStop = false;
            this.groupBox4.Text = "Matching Items Found";
            // 
            // SongsList
            // 
            this.SongsList.CheckBoxes = true;
            this.SongsList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
            this.columnHeader1,
            this.columnHeader2,
            this.columnHeader3,
            this.columnHeader4,
            this.columnHeader5});
            this.SongsList.FullRowSelect = true;
            this.SongsList.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
            this.SongsList.Location = new System.Drawing.Point(6, 19);
            this.SongsList.Name = "SongsList";
            this.SongsList.Size = new System.Drawing.Size(492, 174);
            this.SongsList.TabIndex = 0;
            this.SongsList.UseCompatibleStateImageBehavior = false;
            this.SongsList.View = System.Windows.Forms.View.Details;
            this.SongsList.KeyUp += new System.Windows.Forms.KeyEventHandler(this.SongsList_KeyUp);
            this.SongsList.MouseUp += new System.Windows.Forms.MouseEventHandler(this.SongsList_MouseUp);
            // 
            // columnHeader1
            // 
            this.columnHeader1.Text = "Items";
            this.columnHeader1.Width = 470;
            // 
            // columnHeader2
            // 
            this.columnHeader2.Text = "Song A ID";
            this.columnHeader2.Width = 0;
            // 
            // columnHeader3
            // 
            this.columnHeader3.Text = "Song B ID";
            this.columnHeader3.Width = 0;
            // 
            // columnHeader4
            // 
            this.columnHeader4.Text = "Title B";
            this.columnHeader4.Width = 0;
            // 
            // columnHeader5
            // 
            this.columnHeader5.Text = "Title A";
            this.columnHeader5.Width = 0;
            // 
            // FrmSmartMerge
            // 
            this.ClientSize = new System.Drawing.Size(528, 391);
            this.Controls.Add(this.groupBox4);
            this.Controls.Add(this.ProgressBar1);
            this.Controls.Add(this.cbTickAll);
            this.Controls.Add(this.BtnCancel);
            this.Controls.Add(this.BtnOK);
            this.Controls.Add(this.groupBox2);
            this.Controls.Add(this.groupBox1);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "FrmSmartMerge";
            this.ShowIcon = false;
            this.ShowInTaskbar = false;
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "Smart Merge";
            this.Load += new System.EventHandler(this.FrmSmartMerge_Load);
            this.groupBox1.ResumeLayout(false);
            this.groupBox5.ResumeLayout(false);
            this.groupBox5.PerformLayout();
            this.groupBox3.ResumeLayout(false);
            this.groupBox3.PerformLayout();
            this.groupBox2.ResumeLayout(false);
            this.groupBox6.ResumeLayout(false);
            this.groupBox6.PerformLayout();
            this.groupBox4.ResumeLayout(false);
            this.ResumeLayout(false);
            this.PerformLayout();

		}

        private void BtnCancel_Click(object sender, EventArgs e)
        {
            base.Close();
        }
	}
}
